﻿<UserControl x:Class="InterLinq.Test.UI.ProductsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:this="clr-namespace:InterLinq.Test.UI.Convertor"
    >
    <StackPanel Orientation="Horizontal">
        <StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>Searching for products by Name:</Label>
                <TextBox Width="150" Name="m_searchInput">Product</TextBox>
                <Button Click="Button_Click">Search</Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label Name="m_count">0</Label>
                <Label>products have been returned</Label>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0,33">
                <ListBox Name="m_items" Width="350" Height="400" MouseUp="m_items_MouseUp">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <StackPanel.Visibility>
                                    <Binding>
                                        <Binding.Converter>
                                            <this:IsDefaulToVisibillityConverter/>
                                        </Binding.Converter>
                                    </Binding>
                                </StackPanel.Visibility>
                                <TextBlock Width="150" Text="{Binding Name}"></TextBlock>
                                <TextBlock Width="150" Text="{Binding Price}" HorizontalAlignment="Right"></TextBlock>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <ScrollBar Orientation="Vertical" Minimum="0" ValueChanged="ScrollBar_ValueChanged" Name="m_scrollBar">

                </ScrollBar>
            </StackPanel>

        </StackPanel>
        <StackPanel>
            <StackPanel.Resources>
                <Style x:Key="Header" TargetType="Label">
                    <Setter Property="Width" Value="250"/>
                </Style>
            </StackPanel.Resources>
            <Label>Edit the selected Product</Label>
            <StackPanel Orientation="Horizontal">
                <Label Style="{StaticResource Header}">Name</Label>
                <Label ></Label>
                <TextBox Name="m_name" Width="120"></TextBox>
                <Button Click="Button_Save">Save</Button>
                <Button Click="Button_Delete">Delete</Button>
                <Button Click="Button_New">Add as new Product</Button>
            </StackPanel>
            <Label></Label>
            <Label>Pending changes</Label>
            <ListBox HorizontalAlignment="Left" Name="m_ChangeSetItems" Width="500" Height="400">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock TextWrapping="Wrap" Width="500" Text="{Binding}"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <StackPanel Orientation="Horizontal">
                <Label Style="{StaticResource Header}">Commit changes</Label>
                <Button Click="Button_Commit">Execute</Button>
            </StackPanel>
        </StackPanel>
    </StackPanel>
</UserControl>
